const Sequelize = require('sequelize'); //引入Sequelize模块
const db = require('../db');

//定义model
const Share = db.define('Share', {
    //主键
    id: { type: Sequelize.INTEGER, primaryKey: true, allowNull: false, autoIncrement: true },
    //创建用户
    u_id: { type: Sequelize.INTEGER, primaryKey: true, allowNull: false },
    //标题
    title: { type: Sequelize.TEXT },
    //内容
    content: { type: Sequelize.TEXT },
    //照片路径
    image: { type: Sequelize.STRING(2500) },
    //点赞数
    like: { type: Sequelize.BIGINT },
    //被收藏数字
    collected:{type:Sequelize.BIGINT},
    //创建时间
    created_at: { type: Sequelize.DATE },
    //修改时间
    updated_at: { type: Sequelize.DATE },

}, {
    underscored: true,
    tableName: 'share',
    //timestamps: false//禁用创建时间戳
});

module.exports = Share;
